package com.cjc;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;

import javax.servlet.MultipartConfigElement;

/**
 * springboot框架启动类
 */
@SpringBootApplication
@MapperScan("com.cjc.sport.mapper")
public class SportApplication {

    /**
     * 主方法
     *
     * @param args 默认参数
     */
    public static void main(String[] args) {
        SpringApplication.run(SportApplication.class, args);
    }

    /**
     * 限制上传文件大小
     *
     * @return 配置
     */
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize("10000MB");
        return factory.createMultipartConfig();
    }
}
